import Vue from 'vue'
import Index from '@/components/Index'
import Login from '@/components/Login'
import Main from '@/components/Main'
// import Main from '@/components/MainTranssion'
// import Login from '@/components/LoginTranssion'

/**
 * routes==默认路由节点
 */
export const loginRouter = {
    path: '/login',
    name: 'Login', //登录
    component: Login,
    hidden: true

}
export const appRouter = [{
        path: '/',
        name: 'MainIndex',
        redirect: '/index',
        component: Main,
        title: "首页",
        children: [{
            path: 'index',
            component: Index,
            name: "Index",
            title: "工作台"
        }]
    },
    {
        path: '/otherstorage',
        title: "货代仓储", //登录
        hidden: true,
        name: 'otherstorage',
        component: Main,
        children: [{
                title: '库存商品',
                path: 'storage/list',
                component: resolve => { require(['@/components/Storage/StorageProductList.vue'], resolve) },
                name: "StorageProductList",
            }, {
                title: '库存商品明细',
                path: 'storage/change/list',
                component: resolve => { require(['@/components/Storage/StorageProductChangeList.vue'], resolve) },
                name: "StorageProductChangeList",
            },
            {
                title: '创建入库单',
                path: 'storage/bill/add',
                component: resolve => { require(['@/components/StorageBill/StorageBillAdd.vue'], resolve) },
                name: "StorageBillAdd",
            },  {
                title: '入库单明细',
                path: 'storage/item/list',
                component: resolve => { require(['@/components/StorageBill/StorageBillItemList.vue'], resolve) },
                name: "StorageBillItemList",
            }, {
                title: '入库单管理',
                path: 'storage/bill/list',
                component: resolve => { require(['@/components/StorageBill/StorageBillList.vue'], resolve) },
                name: "StorageBillList",
            }
        ]
    },
    {
        path: '/',
        name: 'TradeIndex',
        redirect: '/trade/index',
        component: Main,
        title: "首页",
        children: [{
            title: '交易订单管理',
            path: 'trade/list',
            component: resolve => { require(['@/components/DisTrade/DisTradeList.vue'], resolve) },
            name: "DisTradeList",
        },{
            title: '创建交易订单',
            path: 'trade/add',
            component: resolve => { require(['@/components/DisTrade/DisTradeEdit.vue'], resolve) },
            name: "DisTradeAdd",
        },
        {
            title: '商品管理',
            path: 'product/list',
            component: resolve => { require(['@/components/DisTrade/DisProductList.vue'], resolve) },
            name: "DisProductList",
        },{
            title: '发货订单管理',
            path: 'waybill/list',
            component: resolve => { require(['@/components/WmsWaybill/WmsWaybillList.vue'], resolve) },
            name: "WaybillList",
        },{
            title: '创建发货单',
            path: 'waybill/add',
            component: resolve => { require(['@/components/WmsWaybill/WmsWaybillAdd.vue'], resolve) },
            name: "WaybillAdd",
        },{
            title: '分销客户',
            path: 'partner/list',
            component: resolve => { require(['@/components/DisPartner/DisPartnerList.vue'], resolve) },
            name: "DisPartnerList",
        }]
    },

]
export const routers = [
    loginRouter,
    ...appRouter

]